# ifndef __PAItems_H_
# define __PAItems_H_

void ShowPostalAddressItems ();

//////////////////////////////////////////////////////////////////////
// INTERNAL USE ONLY.

bool EditPAName (HWND _hWnd, string_t & _strName, string_t & _strAbbrevName, const char * _strTitle);

# include "Map.h"
# include "ListView.h"

void InitCountriesList (CListView & _List);
void FillCountriesList (CListView & _List, const country_t * _pSelectCountry = NULL);
void InitRegionsList   (CListView & _List);
void FillRegionsList   (CListView & _List, const region_t * _pSelectRegion = NULL);

# include "PropertyPages.h"

class CCountriesPage : public CPropertyPages::CPage {
  public:
	CCountriesPage ();

	// Override.
	virtual bool OnInit (HWND _hwndFocus);
	virtual void OnDestroy ();
	virtual void OnCommand (WORD _wCmd, WORD _wNotifyCode, HWND _hwndCtl);
	virtual bool OnNotify (int _idCtrl, NMHDR * _pInfo);

  private:
	CListView m_List;

	void _UpdateTotalCountries ();
};

class CRegionsPage : public CPropertyPages::CPage {
  public:
	CRegionsPage ();

	// Override.
	virtual bool OnInit (HWND _hwndFocus);
	virtual void OnDestroy ();
	virtual void OnCommand (WORD _wCmd, WORD _wNotifyCode, HWND _hwndCtl);
	virtual bool OnNotify (int _idCtrl, NMHDR * _pInfo);

  private:
	CListView m_List;

	void _UpdateTotalRegions ();
};

# include "CitiesList.h"

class CCitiesPage : public CPropertyPages::CPage {
  public:
	CCitiesPage ();

	// Override.
	virtual bool OnInit (HWND _hwndFocus);
	virtual void OnDestroy ();
	virtual void OnActivatePage (const PSHNOTIFY *);
	virtual void OnCommand (WORD _wCmd, WORD _wNotifyCode, HWND _hwndCtl);
	virtual bool OnNotify (int _idCtrl, NMHDR * _pInfo);

  private:
	CCitiesList m_List;

	void _EnableBtns (bool _bEnable, bool _bLocatable);
	void _UpdateTotalCities ();
};

class CZipsPage : public CPropertyPages::CPage {
  public:
	CZipsPage ();

	// Override.
	virtual bool OnInit (HWND _hwndFocus);
	virtual void OnDestroy ();
	virtual void OnCommand (WORD _wCmd, WORD _wNotifyCode, HWND _hwndCtl);
	virtual bool OnNotify (int _idCtrl, NMHDR * _pInfo);

  private:
	CListView m_List;

	void _FillZips (zip_t * _pZip = NULL);
	void _UpdateTotalZips ();
};

class CHighwaysPage : public CPropertyPages::CPage {
  public:
	CHighwaysPage ();

	// Override.
	virtual bool OnInit (HWND _hwndFocus);
	virtual void OnDestroy ();
	virtual void OnCommand (WORD _wCmd, WORD _wNotifyCode, HWND _hwndCtl);
	virtual bool OnNotify (int _idCtrl, NMHDR * _pInfo);

  private:
	CListView m_List;

	void _FillHighways (highway_t * _pHighway = NULL);
	void _UpdateTotalHighways ();
};

/////////////////////////////////////////////

class CCreateOrEditCity : public CDialog {
  public:
	CCreateOrEditCity (city_t * _pCity = NULL) : CDialog (IDD_CREATE_PAI), m_pCity (_pCity) {}

	// Override.
	virtual bool OnInit (HWND _hwndFocus);
	virtual void OnDestroy ();
	virtual void OnCommand (WORD _wCmd, WORD _wNotifyCode, HWND _hwndCtl);
	virtual bool OnNotify (int _idCtrl, NMHDR * _pInfo);

  private:
	city_t * const m_pCity;
	CListView m_List;
};

/////////////////////////////////////////////

const char * OutputPAString (const string_t & _str);

# endif // __PAItems_H_